<?php 
class ZendX_Table_Language extends ZendX_Table_Abstract{
	
	/**
	 * The current list of items
	 *
	 * @since 3.1.0
	 * @var array
	 * @access protected
	 */
	protected $items;
	
	/**
	 * Various information about the current table
	 *
	 * @since 3.1.0
	 * @var array
	 * @access private
	 */
	protected $_args;
	
	/**
	 * Various information needed for displaying the pagination
	 *
	 * @since 3.1.0
	 * @var array
	 * @access private
	 */
	protected $_pagination_args = array();
	
	/**
	 * The current screen
	 *
	 * @since 3.1.0
	 * @var object
	 * @access protected
	*/
	protected $screen;
	
	/**
	 * Cached bulk actions
	 *
	 * @since 3.1.0
	 * @var array
	 * @access private
	 */
	protected $_actions;
	
	/**
	 * Cached pagination output
	 *
	 * @since 3.1.0
	 * @var string
	 * @access private
	 */
	protected $_pagination;
	
	/**
	 * Constructor. The child class should call this constructor from its own constructor
	 *
	 * @param array $args An associative array with information about the current table
	 * @access protected
	 */
	public function __construct($args = array()){
		$this->_args = $args;
	}
	
	/**
	 * Whether the table has items to display or not
	 *
	 * @since 3.1.0
	 * @access public
	 *
	 * @return bool
	 */
	public function has_items() {
		return !empty( $this->items );
	}
	
	/**
	 * Generate the table navigation above or below the table
	 *
	 * @since 3.1.0
	 * @access protected
	 */
	function display_tablenav( $which ) {
		if ( 'top' == $which )
		?>
		<div class="tablenav <?php echo esc_attr( $which ); ?>">
	
			<div class="alignleft actions">
				<?php $this->bulk_actions(); ?>
			</div>
		<?php
			$this->extra_tablenav( $which );
			$this->pagination( $which );
		?>
	
			<br class="clear" />
		</div>
		<?php
	}
	
	/**
	 * Extra controls to be displayed between bulk actions and pagination
	 *
	 * @since 3.1.0
	 * @access protected
	 */
	function extra_tablenav( $which ) {}
	
	/**
	 * Display the pagination.
	 *
	 * @since 3.1.0
	 * @access protected
	 */
	public function pagination( $which ){
		
	}
	
	/**
	 * Print column headers, accounting for hidden and sortable columns.
	 *
	 * @since 3.1.0
	 * @access protected
	 *
	 * @param bool $with_id Whether to set the id attribute or not
	 */
	public function print_column_headers( $with_id = true ) {
	
	}
	
	/**
	 * Generate the <tbody> part of the table
	 *
	 * @since 3.1.0
	 * @access protected
	 */
	public function display_rows_or_placeholder() {
		if ( $this->has_items() ) {
			//$this->display_rows();
		} else {
			//list( $columns, $hidden ) = $this->get_column_info();
			//echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
			//$this->no_items();
			//echo '</td></tr>';
		}
	}
	
	public function display(){
		$this->display_tablenav('top');
		?>
		<table class="table  <?php echo implode( ' ', $this->get_table_classes() ); ?>">
			<thead>
				<tr>
					<?php $this->print_column_headers(); ?>
				</tr>
			</thead>
			
			<tbody>
				<?php $this->display_rows_or_placeholder(); ?>
			</tbody>
			<tfoot>
				<tr><?php $this->print_column_headers( false ); ?></tr>
			</tfoot>
		</table>
		<?php
		$this->display_tablenav('bottom');
	}
	
	/**
	 * Get a list of CSS classes for the <table> tag
	 *
	 * @since 3.1.0
	 * @access protected
	 *
	 * @return array
	 */
	public function get_table_classes() {
		return array( 'widefat', 'fixed', $this->_args['plural'] );
	}
	
}
?>